<?php

use App\Http\Controllers\Admin;
use App\Http\Controllers;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// 后台接口

//后台管理员登录
Route::post('admin/login/login', [Admin\LoginController::class, 'login']);
Route::get('admin/login/getCaptcha', [Admin\LoginController::class, 'getCaptcha']); //获取图形验证码
Route::get('slideVerify/getCaptcha', [App\Http\Controllers\SlideVerifyController::class, 'getCaptcha']); //获取滑动验证码参数

Route::get('text/bookTypesFilterList', [App\Http\Controllers\TextController::class, 'bookTypesFilterList']); //书籍类型筛选列表(用于下拉框选择)

Route::get('text/getCityAll', [App\Http\Controllers\TextController::class, 'getCityAll']); //获取城市列表

//文件上传
Route::post('/uploads/files', [App\Http\Controllers\UploadsFileController::class, 'commonUpload']); //公共文件上传
Route::post('/uploadsEbook/files', [App\Http\Controllers\UploadsFileEbookController::class, 'commonUpload']); //公共文件上传(上传电子书)


Route::middleware(['check.admin.header.token'])->prefix('admin')->group(function () {

    /**
     * 管理员管理
     */
    Route::get('/manage/filterList', [Admin\ManageController::class, 'filterList']);
    Route::get('/manage/list', [Admin\ManageController::class, 'lists']);
    Route::get('/manage/detail', [Admin\ManageController::class, 'detail']);
    Route::post('/manage/add', [Admin\ManageController::class, 'add']);
    Route::post('/manage/change', [Admin\ManageController::class, 'change']);
    Route::post('/manage/del', [Admin\ManageController::class, 'del']);
    Route::post('/manage/changePwd', [Admin\ManageController::class, 'manageChangePwd']); //修改密码
    Route::post('/manage/changeSelfPwd', [Admin\ManageController::class, 'manageChangeSelfPwd']); //修改自己的密码


    /**
     * 应用显示灰色
     */
    Route::get('/appViewGray/list', [Admin\AppViewGrayController::class, 'lists']); // 列表
    Route::get('/appViewGray/detail', [Admin\AppViewGrayController::class, 'detail']); // 详情
    Route::post('/appViewGray/add', [Admin\AppViewGrayController::class, 'add']); // 新增
    Route::post('/appViewGray/change', [Admin\AppViewGrayController::class, 'change']); // 编辑
    Route::post('/appViewGray/del', [Admin\AppViewGrayController::class, 'del']); // 删除

    /**
     * 权限
     */
    Route::get('/permission/list', [Admin\PermissionController::class, 'permissionList']); // 权限列表
    Route::get('/permission/tree', [Admin\PermissionController::class, 'permissionTree']); // 权限树形列表
    Route::get('/permission/detail', [Admin\PermissionController::class, 'permissionDetail']); // 权限详情
    Route::post('/permission/add', [Admin\PermissionController::class, 'permissionInsert']); // 权限新增
    Route::post('/permission/change', [Admin\PermissionController::class, 'permissionChange']); // 权限编辑
    Route::post('/permission/del', [Admin\PermissionController::class, 'permissionDel']); // 权限删除
    Route::post('/permission/orderChange', [Admin\PermissionController::class, 'permissionOrderChange']); // 更改权限排序

    /**
     * 角色
     */
    Route::get('/role/list', [Admin\RoleController::class, 'roleList']); // 角色列表
    Route::get('/role/filterList', [Admin\RoleController::class, 'roleFilterList']); // 角色列表 （筛选使用）
    Route::get('/role/detail', [Admin\RoleController::class, 'roleDetail']); // 角色详情
    Route::post('/role/add', [Admin\RoleController::class, 'roleAdd']); // 角色新增
    Route::post('/role/change', [Admin\RoleController::class, 'roleChange']); // 角色编辑
    Route::post('/role/del', [Admin\RoleController::class, 'roleDel']); // 角色删除



    /**
     * banner管理
     */
    Route::get('/banner/list', [Admin\BannerController::class, 'lists']); // 列表
    Route::get('/banner/detail', [Admin\BannerController::class, 'detail']); // 详情
    Route::post('/banner/add', [Admin\BannerController::class, 'add']); // 新增
    Route::post('/banner/change', [Admin\BannerController::class, 'change']); // 编辑
    Route::post('/banner/del', [Admin\BannerController::class, 'del']); // 删除
    Route::post('/banner/displayChange', [Admin\BannerController::class, 'displayChange']); // 切换显示方式
    Route::post('/banner/sortChange', [Admin\BannerController::class, 'sortChange']); // banner 图排序



    /**
     * 积分设置
     */
    Route::get('/scoreInfo/list', [Admin\ScoreInfoController::class, 'lists']); // 积分规则列表
    Route::post('/scoreInfo/change', [Admin\ScoreInfoController::class, 'change']); // 修改积分规则
    Route::get('/scoreInfo/scoreLog', [Admin\ScoreInfoController::class, 'scoreLog']); // 积分变动记录
    Route::post('/scoreInfo/scoreChange', [Admin\ScoreInfoController::class, 'scoreChange']); // 调整用户积分


    Route::get('/scoreInfo/customScoreRule', [Admin\ScoreInfoController::class, 'customScoreRule']); // 获取自定义积分规则
    Route::post('/scoreInfo/customScoreRuleChange', [Admin\ScoreInfoController::class, 'customScoreRuleChange']); // 设置自定义积分规则

    /**
     * 违规设置
     */
    Route::get('/violateConfig/detail', [Admin\ViolateConfigController::class, 'detail']); // 详情
    Route::post('/violateConfig/change', [Admin\ViolateConfigController::class, 'change']); // 修改违规设置

    /**
     * 用户管理
     */
    Route::get('/userInfo/list', [Admin\UserInfoController::class, 'lists']); //用户列表
    Route::post('/userInfo/clearViolate', [Admin\UserInfoController::class, 'clearViolate']); //  清空违规次数

    /**
     * 用户留言管理
     */
    Route::get('/feedback/list', [Admin\FeedbackController::class, 'lists']); //用户留言列表
    Route::post('/feedback/reply', [Admin\FeedbackController::class, 'reply']); //  用户留言回复


    /**
     * 主页信息
     */
    Route::get('/index/index', [Admin\IndexController::class, 'index']); //首页数据统计
    Route::get('/index/accessStatistics', [Admin\IndexController::class, 'accessStatistics']); //公众号访问统计


    /**
     * 数字资源总数据管理
     */
    Route::get('/resourceTotal/list', [Admin\ResourceTotalController::class, 'lists']);
    Route::get('/resourceTotal/detail', [Admin\ResourceTotalController::class, 'detail']);
    Route::post('/resourceTotal/del', [Admin\ResourceTotalController::class, 'del']);


    /**
     * 数字资源总数据大类型管理（对接对外资源）（系统内定，只能修改，不能添加）
     */
    Route::get('/resourceType/filterList', [Admin\ResourceTypeController::class, 'filterList']); //数字阅读类型列表（用于筛选）
    Route::get('/resourceType/list', [Admin\ResourceTypeController::class, 'lists']);
    Route::get('/resourceType/detail', [Admin\ResourceTypeController::class, 'detail']);
    //  Route::post('/resourceType/add', [Admin\ResourceTypeController::class, 'add']);
    Route::post('/resourceType/change', [Admin\ResourceTypeController::class, 'change']);
    // Route::post('/resourceType/del', [Admin\ResourceTypeController::class, 'del']);




    /**
     * 数字资源类型
     */
    Route::get('/resourceTotalType/filterList', [Admin\ResourceTotalTypeController::class, 'filterList']); // 筛选列表
    Route::get('/resourceTotalType/list', [Admin\ResourceTotalTypeController::class, 'lists']); // 列表
    Route::get('/resourceTotalType/detail', [Admin\ResourceTotalTypeController::class, 'detail']); // 详情
    Route::post('/resourceTotalType/add', [Admin\ResourceTotalTypeController::class, 'add']); // 新增
    Route::post('/resourceTotalType/change', [Admin\ResourceTotalTypeController::class, 'change']); // 编辑
    Route::post('/resourceTotalType/del', [Admin\ResourceTotalTypeController::class, 'del']); // 删除


    /**
     * 音频管理
     */
    Route::get('/resourceAudioManage/list', [Admin\ResourceAudioManageController::class, 'lists']); // 列表
    Route::get('/resourceAudioManage/detail', [Admin\ResourceAudioManageController::class, 'detail']); // 详情
    Route::post('/resourceAudioManage/add', [Admin\ResourceAudioManageController::class, 'add']); // 新增
    Route::post('/resourceAudioManage/change', [Admin\ResourceAudioManageController::class, 'change']); // 编辑
    Route::post('/resourceAudioManage/del', [Admin\ResourceAudioManageController::class, 'del']); // 删除
    Route::post('/resourceAudioManage/cancelAndRelease', [Admin\ResourceAudioManageController::class, 'cancelAndRelease']); // 撤销 和 发布

    /**
     * 音频章节管理
     */
    Route::get('/resourceAudioChapterManage/list', [Admin\ResourceAudioChapterManageController::class, 'lists']); // 列表
    Route::get('/resourceAudioChapterManage/detail', [Admin\ResourceAudioChapterManageController::class, 'detail']); // 详情
    Route::post('/resourceAudioChapterManage/add', [Admin\ResourceAudioChapterManageController::class, 'add']); // 新增
    Route::post('/resourceAudioChapterManage/change', [Admin\ResourceAudioChapterManageController::class, 'change']); // 编辑
    Route::post('/resourceAudioChapterManage/del', [Admin\ResourceAudioChapterManageController::class, 'del']); // 删除
    Route::post('/resourceAudioChapterManage/sortChange', [Admin\ResourceAudioChapterManageController::class, 'sortChange']); // 排序


    /**
     * 视频管理
     */
    Route::get('/resourceVideoManage/list', [Admin\ResourceVideoManageController::class, 'lists']); // 列表
    Route::get('/resourceVideoManage/detail', [Admin\ResourceVideoManageController::class, 'detail']); // 详情
    Route::post('/resourceVideoManage/add', [Admin\ResourceVideoManageController::class, 'add']); // 新增
    Route::post('/resourceVideoManage/change', [Admin\ResourceVideoManageController::class, 'change']); // 编辑
    Route::post('/resourceVideoManage/del', [Admin\ResourceVideoManageController::class, 'del']); // 删除
    Route::post('/resourceVideoManage/del', [Admin\ResourceVideoManageController::class, 'del']); // 删除
    Route::post('/resourceVideoManage/cancelAndRelease', [Admin\ResourceVideoManageController::class, 'cancelAndRelease']); // 撤销 和 发布

    /**
     * 视频集数管理
     */
    Route::get('/resourceVideoGatherManage/list', [Admin\ResourceVideoGatherManageController::class, 'lists']); // 列表
    Route::get('/resourceVideoGatherManage/detail', [Admin\ResourceVideoGatherManageController::class, 'detail']); // 详情
    Route::post('/resourceVideoGatherManage/add', [Admin\ResourceVideoGatherManageController::class, 'add']); // 新增
    Route::post('/resourceVideoGatherManage/change', [Admin\ResourceVideoGatherManageController::class, 'change']); // 编辑
    Route::post('/resourceVideoGatherManage/del', [Admin\ResourceVideoGatherManageController::class, 'del']); // 删除
    Route::post('/resourceVideoGatherManage/sortChange', [Admin\ResourceVideoGatherManageController::class, 'sortChange']); // 排序

    /**
     * 电子书管理
     */
    Route::get('/resourceEbookInfoManage/list', [Admin\ResourceEbookInfoManageController::class, 'lists']); // 列表
    Route::get('/resourceEbookInfoManage/detail', [Admin\ResourceEbookInfoManageController::class, 'detail']); // 详情
    Route::post('/resourceEbookInfoManage/add', [Admin\ResourceEbookInfoManageController::class, 'add']); // 新增
    Route::post('/resourceEbookInfoManage/change', [Admin\ResourceEbookInfoManageController::class, 'change']); // 编辑
    Route::post('/resourceEbookInfoManage/del', [Admin\ResourceEbookInfoManageController::class, 'del']); // 删除
    Route::post('/resourceEbookInfoManage/cancelAndRelease', [Admin\ResourceEbookInfoManageController::class, 'cancelAndRelease']); // 撤销 和 发布




    /**
     * 对外数据记录管理
     */
    Route::get('/externalDataRecord/list', [Admin\ExternalDataRecordController::class, 'lists']); // 列表
    Route::get('/externalDataRecord/detail', [Admin\ExternalDataRecordController::class, 'detail']); // 详情
    Route::post('/externalDataRecord/add', [Admin\ExternalDataRecordController::class, 'add']); // 新增
    Route::post('/externalDataRecord/change', [Admin\ExternalDataRecordController::class, 'change']); // 编辑
    Route::post('/externalDataRecord/del', [Admin\ExternalDataRecordController::class, 'del']); // 删除

});
